<?php

namespace app\user\controller;

use think\Controller;
use think\Db;
use think\Request;
use think\Session;

class Mycontroller extends Controller
{
    //
    public function _initialize()
    {
        $session=Request::instance()->session();
//        var_dump($session);die;
        if(empty($session['user']['id']))
        {
            $this->redirect('user/Login/index');
        }
    }

    public function msg()
    {
        $uid=Session::get('user.id');
//        $uid=5;


//        return $uid;
        $data=Db::name('user_msg')->field(true)->where('uid',$uid)->where('status',2)->select();
//        var_dump($data);
        if($data){
            return true;
        }else{
            return false;
        }



    }
}
